// ++++++++++++++++++++++++++++++++++++++++
// 《零基础Go语言算法实战》源码
// ++++++++++++++++++++++++++++++++++++++++
// Author:廖显东（ShirDon）
// Blog:https://www.shirdon.com/
// Gitee:https://gitee.com/shirdonl/goAlgorithms.git
// Buy link :https://item.jd.com/14101229.html
// ++++++++++++++++++++++++++++++++++++++++

package main

import "fmt"

func main() {
	fmt.Println("result:", def())
}

func def() int {
	var i int
	defer func() {
		i++
		fmt.Println("a", i)
	}()
	defer func() {
		i++
		fmt.Println("b", i)
	}()
	return i
}
